﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsultasLogopedia.Core.Controllers
{    
    public interface IGenericBusinessController<T,ID> : IGenericReadOnlyBusinessController<T, ID>
    {
        /// <summary>
        /// Saves an entity
        /// </summary>
        /// <param name="entity"></param>
        void Save(T entity);

        /// <summary>
        /// Saves or updates an entity
        /// </summary>
        /// <param name="entity"></param>
        void SaveOrUpdate(T entity);

        /// <summary>
        /// Updates an entity
        /// </summary>
        /// <param name="entity"></param>
        void Update(T entity);

        /// <summary>
        /// Deletes an entity
        /// </summary>
        /// <param name="entity"></param>
        void Delete(T entity);

        /// <summary>
        /// Deletes an entity by its id
        /// </summary>
        /// <param name="id"></param>
        void DeleteById(ID id);

        /// <summary>
        /// Refresh an entity
        /// </summary>
        /// <param name="entity"></param>
        void Refresh(T entity);
    }
}
